<template>
  <div style="position: relative">
    <div style="position: absolute; left: 20px; z-index: 2001">
      <el-radio-group v-model="type" @input="handle()">
        <el-radio label="1">本周</el-radio>
        <el-radio label="2">本月</el-radio>
      </el-radio-group>
    </div>
    <div style="margin: 20px 0">
      <line-stack name="countStore" :data="countStore" />
    </div>
  </div>
</template>
<script>
import lineStack from '@c/echarts/line-stack'
export default {
  components: {
    lineStack,
  },
  data() {
    return {
      type: '1',
      countStore: { categories: [], series: [] },
    }
  },
  created() {
    this.handle()
  },
  methods: {
    handle() {
      this.countStoreList()
    },
    countStoreList() {
      this.$axios
        .get(`/count/bigscreent2/countStore3?type=${this.type}`)
        .then((data) => {
          this.countStore = { categories: [], series: [] }
          if (data.code == 200) {
            this.countStore = data.data
          } else {
            this.$message.error(data.msg)
          }
        })
    },
  },
}
</script>
